home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 1998 November / maximum-cd-1998-11.iso / Truespace 4 / Data / PROGRAM / PROCSETS / set030 < prev    next >
Encoding:
Text File  |  1998-08-28  |  7.3 KB  |  455 lines

  1. %%BeginResource: procset Adobe_ColorImage_AI6 1.1 0
  2. userdict /Adobe_ColorImage_AI6 known not
  3. {
  4.     userdict /Adobe_ColorImage_AI6 24 dict put
  5. } if
  6. userdict /Adobe_ColorImage_AI6 get begin
  7. /initialize
  8. {
  9.     Adobe_ColorImage_AI6 begin
  10.     Adobe_ColorImage_AI6
  11.     {
  12.         dup type /arraytype eq
  13.         {
  14.             dup xcheck
  15.             {
  16.                 bind
  17.             } if
  18.         } if
  19.         pop pop
  20.     } forall
  21. } def
  22. /terminate { end } def
  23. currentdict /Adobe_ColorImage_AI6_Vars known not
  24. {
  25.     /Adobe_ColorImage_AI6_Vars 15 dict def
  26. } if
  27. Adobe_ColorImage_AI6_Vars begin
  28.     /channelcount 0 def
  29.     /sourcecount 0 def
  30.     /sourcearray 4 array def
  31.     /plateindex -1 def
  32.     /XIMask 0 def
  33.     /XIBinary 0 def
  34.     /XIChannelCount 0 def
  35.     /XIBitsPerPixel 0 def
  36.     /XIImageHeight 0 def
  37.     /XIImageWidth 0 def
  38.     /XIImageMatrix null def
  39.     /XIBuffer null def
  40.     /XIDataProc null def
  41.     /XIVersion 6 def
  42. end
  43. /WalkRGBString null def
  44. /WalkCMYKString null def
  45. /StuffRGBIntoGrayString null def
  46. /RGBToGrayImageProc null def
  47. /StuffCMYKIntoGrayString null def
  48. /CMYKToGrayImageProc null def
  49. /ColorImageCompositeEmulator null def
  50. /SeparateCMYKImageProc null def
  51. /FourEqual null def
  52. /TestPlateIndex null def
  53. currentdict /_colorimage known not
  54. {
  55.     /colorimage where
  56.     {
  57.         /colorimage get /_colorimage exch def
  58.     }
  59.     {
  60.         /_colorimage null def
  61.     } ifelse
  62. } if
  63. /_currenttransfer systemdict /currenttransfer get def
  64. /colorimage null def
  65. /XI null def
  66. /WalkRGBString
  67. {
  68.     0 3 index
  69.     dup length 1 sub 0 3 3 -1 roll
  70.     {
  71.         3 getinterval { } forall
  72.         5 index exec
  73.         3 index
  74.     } for
  75.  
  76.      5 { pop } repeat
  77. } def
  78. /WalkCMYKString
  79. {
  80.     0 3 index
  81.     dup length 1 sub 0 4 3 -1 roll
  82.     {
  83.         4 getinterval { } forall
  84.  
  85.         6 index exec
  86.  
  87.         3 index
  88.  
  89.     } for
  90.  
  91.     5 { pop } repeat
  92.  
  93. } def
  94. /StuffRGBIntoGrayString
  95. {
  96.     .11 mul exch
  97.  
  98.     .59 mul add exch
  99.  
  100.     .3 mul add
  101.  
  102.     cvi 3 copy put
  103.  
  104.     pop 1 add
  105. } def
  106. /RGBToGrayImageProc
  107. {
  108.     Adobe_ColorImage_AI6_Vars begin
  109.         sourcearray 0 get exec
  110.         dup length 3 idiv string
  111.         dup 3 1 roll
  112.  
  113.         /StuffRGBIntoGrayString load exch
  114.         WalkRGBString
  115.  end
  116. } def
  117. /StuffCMYKIntoGrayString
  118. {
  119.     exch .11 mul add
  120.  
  121.     exch .59 mul add
  122.  
  123.     exch .3 mul add
  124.  
  125.     dup 255 gt { pop 255 } if
  126.  
  127.     255 exch sub cvi 3 copy put
  128.  
  129.     pop 1 add
  130. } def
  131. /CMYKToGrayImageProc
  132. {
  133.     Adobe_ColorImage_AI6_Vars begin
  134.         sourcearray 0 get exec
  135.         dup length 4 idiv string
  136.         dup 3 1 roll
  137.  
  138.         /StuffCMYKIntoGrayString load exch
  139.         WalkCMYKString
  140.  end
  141. } def
  142. /ColorImageCompositeEmulator
  143. {
  144.     pop true eq
  145.     {
  146.         Adobe_ColorImage_AI6_Vars /sourcecount get 5 add { pop } repeat
  147.     }
  148.     {
  149.         Adobe_ColorImage_AI6_Vars /channelcount get 1 ne
  150.         {
  151.             Adobe_ColorImage_AI6_Vars begin
  152.                 sourcearray 0 3 -1 roll put
  153.  
  154.                 channelcount 3 eq
  155.                 {
  156.                     /RGBToGrayImageProc
  157.                 }
  158.                 {
  159.                     /CMYKToGrayImageProc
  160.                 } ifelse
  161.                 load
  162.          end
  163.         } if
  164.         image
  165.     } ifelse
  166. } def
  167. /SeparateCMYKImageProc
  168. {
  169.     Adobe_ColorImage_AI6_Vars begin
  170.         sourcecount 0 ne
  171.         {
  172.             sourcearray plateindex get exec
  173.         }
  174.         {
  175.             sourcearray 0 get exec
  176.  
  177.             dup length 4 idiv string
  178.  
  179.             0 2 index
  180.  
  181.             plateindex 4 2 index length 1 sub
  182.             {
  183.                 get 255 exch sub
  184.  
  185.                 3 copy put pop 1 add
  186.  
  187.                 2 index
  188.             } for
  189.             pop pop exch pop
  190.         } ifelse
  191.  end
  192. } def
  193.  
  194. /FourEqual
  195. {
  196.     4 index ne
  197.     {
  198.         pop pop pop false
  199.     }
  200.     {
  201.         4 index ne
  202.         {
  203.             pop pop false
  204.         }
  205.         {
  206.             4 index ne
  207.             {
  208.                 pop false
  209.             }
  210.             {
  211.                 4 index eq
  212.             } ifelse
  213.         } ifelse
  214.     } ifelse
  215. } def
  216. /TestPlateIndex
  217. {
  218.     Adobe_ColorImage_AI6_Vars begin
  219.         /plateindex -1 def
  220.         /setcmykcolor where
  221.         {
  222.             pop
  223.             gsave
  224.             1 0 0 0 setcmykcolor systemdict /currentgray get exec 1 exch sub
  225.             0 1 0 0 setcmykcolor systemdict /currentgray get exec 1 exch sub
  226.             0 0 1 0 setcmykcolor systemdict /currentgray get exec 1 exch sub
  227.             0 0 0 1 setcmykcolor systemdict /currentgray get exec 1 exch sub
  228.             grestore
  229.             1 0 0 0 FourEqual
  230.             {
  231.                 /plateindex 0 def
  232.             }
  233.             {
  234.                 0 1 0 0 FourEqual
  235.                 {
  236.                     /plateindex 1 def
  237.                 }
  238.                 {
  239.                     0 0 1 0 FourEqual
  240.                     {
  241.                         /plateindex 2 def
  242.                     }
  243.                     {
  244.                         0 0 0 1 FourEqual
  245.                         {
  246.                             /plateindex 3 def
  247.                         }
  248.                         {
  249.                             0 0 0 0 FourEqual
  250.                             {
  251.                                 /plateindex 5 def
  252.                             } if
  253.                         } ifelse
  254.                     } ifelse
  255.                 } ifelse
  256.             } ifelse
  257.             pop pop pop pop
  258.         } if
  259.         plateindex
  260.  end
  261. } def
  262. /colorimage
  263. {
  264.     Adobe_ColorImage_AI6_Vars begin
  265.         /channelcount 1 index def
  266.         /sourcecount 2 index 1 eq { channelcount 1 sub } { 0 } ifelse def
  267.         4 sourcecount add index dup
  268.         8 eq exch 1 eq or not
  269.  end
  270.  
  271.     {
  272.         /_colorimage load null ne
  273.         {
  274.             _colorimage
  275.         }
  276.         {
  277.             Adobe_ColorImage_AI6_Vars /sourcecount get
  278.             7 add { pop } repeat
  279.         } ifelse
  280.     }
  281.     {
  282.         dup 3 eq
  283.         TestPlateIndex
  284.         dup -1 eq exch 5 eq or or
  285.         {
  286.             /_colorimage load null eq
  287.             {
  288.                 ColorImageCompositeEmulator
  289.             }
  290.             {
  291.                 dup 1 eq
  292.                 {
  293.                     pop pop image
  294.                 }
  295.                 {
  296.                     Adobe_ColorImage_AI6_Vars /plateindex get 5 eq
  297.                     {
  298.                         gsave
  299.  
  300.                         0 _currenttransfer exec
  301.                         1 _currenttransfer exec
  302.                         eq
  303.                         { 0 _currenttransfer exec 0.5 lt }
  304.                         { 0 _currenttransfer exec 1 _currenttransfer exec gt } ifelse
  305.  
  306.                         { { pop 0 } } { { pop 1 } } ifelse
  307.                         systemdict /settransfer get exec
  308.                     } if
  309.  
  310.                     _colorimage
  311.  
  312.                     Adobe_ColorImage_AI6_Vars /plateindex get 5 eq
  313.                     {
  314.                         grestore
  315.                     } if
  316.                 } ifelse
  317.             } ifelse
  318.         }
  319.         {
  320.             dup 1 eq
  321.             {
  322.                 pop pop
  323.                 image
  324.             }
  325.             {
  326.                 pop pop
  327.                 Adobe_ColorImage_AI6_Vars begin
  328.                     sourcecount -1 0
  329.                     {
  330.                         exch sourcearray 3 1 roll put
  331.                     } for
  332.                     /SeparateCMYKImageProc load
  333.              end
  334.                 systemdict /image get exec
  335.             } ifelse
  336.         } ifelse
  337.     } ifelse
  338. } def
  339. /XG
  340. {
  341.     pop pop
  342. } def
  343. /XF
  344. {
  345.     13 {pop} repeat
  346. } def
  347. /Xh
  348. {
  349.     Adobe_ColorImage_AI6_Vars begin
  350.         gsave
  351.         /XIMask exch 0 ne def
  352.         /XIImageHeight exch def
  353.         /XIImageWidth exch def
  354.         /XIImageMatrix exch def
  355.         0 0 moveto
  356.         XIImageMatrix concat
  357.         XIImageWidth XIImageHeight scale
  358.  
  359.         XIMask
  360.         {
  361.             /_lp /null ddef
  362.             _fc
  363.             /_lp /imagemask ddef
  364.         }
  365.         if
  366.         /XIVersion 7 def
  367.  end
  368. } def
  369. /XH
  370. {
  371.     Adobe_ColorImage_AI6_Vars begin
  372.         /XIVersion 6 def
  373.         grestore
  374.  end
  375. } def
  376. /XI
  377. {
  378.     Adobe_ColorImage_AI6_Vars begin
  379.         gsave
  380.         /XIMask exch 0 ne def
  381.         /XIBinary exch 0 ne def
  382.         pop
  383.         pop
  384.         /XIChannelCount exch def
  385.         /XIBitsPerPixel exch def
  386.         /XIImageHeight exch def
  387.         /XIImageWidth exch def
  388.         pop pop pop pop
  389.         /XIImageMatrix exch def
  390.         XIBitsPerPixel 1 eq
  391.         {
  392.             XIImageWidth 8 div ceiling cvi
  393.         }
  394.         {
  395.             XIImageWidth XIChannelCount mul
  396.         } ifelse
  397.         /XIBuffer exch string def
  398.         XIBinary
  399.         {
  400.             /XIDataProc { currentfile XIBuffer readstring pop } def
  401.             XIVersion 6 le
  402.             {
  403.                 currentfile 128 string readline pop pop
  404.             }
  405.             if
  406.         }
  407.         {
  408.             /XIDataProc { currentfile XIBuffer readhexstring pop } def
  409.         } ifelse
  410.  
  411.         XIVersion 6 le
  412.         {
  413.             0 0 moveto
  414.             XIImageMatrix concat
  415.             XIImageWidth XIImageHeight scale
  416.             XIMask
  417.             {
  418.                 /_lp /null ddef
  419.                 _fc
  420.                 /_lp /imagemask ddef
  421.             } if
  422.         } if
  423.  
  424.         XIMask
  425.         {
  426.             XIImageWidth XIImageHeight
  427.             false
  428.             [ XIImageWidth 0 0 XIImageHeight neg 0 0 ]
  429.             /XIDataProc load
  430.             imagemask
  431.         }
  432.         {
  433.             XIImageWidth XIImageHeight
  434.             XIBitsPerPixel
  435.             [ XIImageWidth 0 0 XIImageHeight neg 0 0 ]
  436.             /XIDataProc load
  437.  
  438.             XIChannelCount 1 eq
  439.             {
  440.                 gsave
  441.                 0 setgray
  442.                 image
  443.                 grestore
  444.             }
  445.             {
  446.                 false
  447.                 XIChannelCount
  448.                 colorimage
  449.             } ifelse
  450.         } ifelse
  451.         grestore
  452.  end
  453. } def
  454. end
  455. %%EndResource